/**
 * Project Name:ylbx
 * File Name:StaBxmidleDataSource.java
 * Package Name:dln.stat.impl
 * Copyright (c) 2014, All Rights Reserved.
 *
 */
package dln.stat.ds;

import dao.hb.BxMidle;
import dao.hb.UUser;

/**
 * ClassName: StaBxmidleDataSource <br/>
 * Function: 机构
 * date: May 24, 2014 11:02:47 AM <br/>
 *
 * @author $dev
 * @version 1.0
 */
public class InstituteDataSource extends StaBxmidleDataSource {
	
	public InstituteDataSource(String nameQuery) {
		super(nameQuery);
	}
	
    /* (non-Javadoc)
     * @see dln.stat.ds.StaBxmidleDataSource#groupUnEquals(java.lang.Object, java.lang.Object)
     */
    @Override
	protected boolean groupUnEquals(Object lastGroup, Object group) {
		return lastGroup != null && !((UUser)group).getId().equals(((UUser)lastGroup).getId()) ;
	}

	/* (non-Javadoc)
	 * @see dln.stat.ds.StaBxmidleDataSource#preProcess(java.lang.Object, dao.hb.BxMidle)
	 */
	@Override
	protected Object preProcess(Object obj, BxMidle b) {
		UUser u = new UUser();
        if (obj.getClass().isArray()) {
            Object[] o = (Object[]) obj;
            u = o[0] != null ? (UUser) o[0] : u;
            b.setBxtype(o[1] != null ? o[1].toString() : "");
            b.setPayone(o[2] != null ? (Double) o[2] : 0.0);
            b.setPaytwo(o[3] != null ? (Double) o[3] : 0.0);
            b.setPayall(o[4] != null ? (Double) o[4] : 0.0);
            b.setBxSum(o[5] != null ? (Double) o[5] : 0.0);
        }
		return u;
	}

}